<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>使用浮动float 高度塌陷问题</title>
		<style type="text/css">
			[class^=box]{
				width: 200px;
				height: 200px;
				border: 1px solid #FF0000;
				float: left;
			}
			.goodslist{
				border: 5px solid #1479D7;
				/* height: 200px; */
				/* 高度塌陷解决办法 */
				overflow: hidden;
			}
			.hotgoods .box1{
				float: none;
			}
		</style>
	</head>
	<body>
		<!--高度塌陷-->
		<div class="goodslist">
			<div class="box1">
				商品1
			</div>
			<div class="box1">
				商品2
			</div>
			<div class="box1">
				商品3
			</div>
			<div class="box1">
				商品4
			</div>
		</div>
		<!--第二组商品列表-->
		<div class="hotgoods">
			<div class="box1" style="width: 300px;background-color: pink;">
				商品1111
			</div>
			<div class="box1">
				商品2222
			</div>
			<div class="box1">
				商品3333
			</div>
			<div class="box1">
				商品4444
			</div>
		</div>
	</body>
</html>
